package customerEnter.Frame.ehcache.Judge;

import customerEnter.tool.WhetherToEmpty;

/**
 * 放sql語句
 * 
 * 类名称：MapEcacheSqlQUery 类描述： 创建人：dy 创建时间：2016-4-27 上午11:19:15
 * 
 */
@SuppressWarnings({ "static-access" })
public class MapEcacheSqlQUery {
	private static MapEcacheSqlQUery	MapEcacheSqlQUery;
	private final static String			setMap	= "MapEcacheSqlQUery";

	private MapEcacheSqlQUery() {
	}

	public static MapEcacheSqlQUery getMapEcacheSqlQUery() {
		if (WhetherToEmpty.ObjectWhetherToEmpty(MapEcacheSqlQUery)) {
			MapEcacheSqlQUery = new MapEcacheSqlQUery();
		}
		return MapEcacheSqlQUery;
	}

	/**
	 * 設置數據sql
	 */
	public static void SetDataIf(String key, String sql) {
		MapEcache.getMapEcache(setMap).setEachMap(key, sql);
	}

	public static String GetDataIf(String key) {
		String str = "";
		try {
			str = MapEcache.getMapEcache(setMap).getEachMap(key).toString();
		} catch (Exception e) {
			str = null;
		}
		return str;
	}
}
